/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package phd.dupenois.changeidentifiers;



/**
 *
 * @author Max
 */
public abstract class ChangeIdentifier implements ChangeIdentifierInterface{
    private ChangeIdentifierHolder holder;
    public final void setHolder(ChangeIdentifierHolder holder){
        if(this.holder!=null) return;
        this.holder = holder;
    }
    
    protected final int getTimeStep(){
        return this.holder.getTimeStep();
    }
    protected final double getMultiplier(){
        return this.holder.getMultiplier();
    }
    protected final double getPriority(){
        return this.holder.getPriority();
    }
    protected final double getThreshold(){
        return this.holder.getThreshold();
    }
    protected final boolean isRedrawOnFail(){
        return this.holder.isRedrawOnFail();
    }

    protected double changeValue(double previous, double current){
        return (Math.abs(current-previous))/previous;
    }

//    private PropertiesHolder propertiesHolder;
//    public final void setPropertiesHolder(PropertiesHolder propertiesHolder){
//        this.propertiesHolder = propertiesHolder;
//    }
//    protected final PropertiesHolder getPropertiesHolder(){
//        return this.propertiesHolder;
//    }
}
